package com.lxy.cxcyxmmsbackend.sys.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lxy.cxcyxmmsbackend.sys.entity.KeyValue;
import com.lxy.cxcyxmmsbackend.sys.entity.XmCy;
import com.lxy.cxcyxmmsbackend.sys.exceptionHandle.exce.NormalException;
import com.lxy.cxcyxmmsbackend.sys.res.Result;
import com.lxy.cxcyxmmsbackend.sys.service.XmCyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 刘新颖
 * @since 2024-02-28
 */
@RestController
@RequestMapping("/xmCy")
public class XmCyController {

    @Autowired
    XmCyService xmCyService;

    @ApiOperation("新增项目成员")
    @PostMapping("addXmcys")
    public Result addXmcys(@RequestBody List<XmCy> xmCyList){
        boolean b = xmCyService.saveBatch(xmCyList);
        if (!b){
            throw new NormalException("添加项目成员失败");
        }
        return Result.success("添加项目成员成功",null);
    }

}

